﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using Intelligent.OTC.Domain.DataModel;
using Intelligent.OTC.Common.UnitOfWork;
using Intelligent.OTC.Domain;
using Intelligent.OTC.Business;
using Intelligent.OTC.Domain.Repositories;
using Intelligent.OTC.Common;
using System.Configuration;
using System.IO;
using Intelligent.OTC.Common.Utils;
using Intelligent.OTC.WebApi.Core;
using Intelligent.OTC.Common.Attr;

namespace Intelligent.OTC.WebApi.Controllers
{
    [UserAuthorizeFilter(actionSet: "common")]
    public class ContactHistoryController : ApiController
    {
        [HttpGet]
        [PagingQueryable]
        public IEnumerable<ContactHistory> Get()
        {
            ContactService service = SpringFactory.GetObjectImpl<ContactService>("ContactService");
            return service.GetContactHistory().AsQueryable<ContactHistory>();
        }

        [HttpGet]
        public DisputeInvoice GetDisputeInvoice(string type)
        {
            DisputeInvoice disInv = new DisputeInvoice();
            return disInv;
        }

        [HttpPost]
        public void saveInfo([FromBody]DisputeInvoice disInvInstance)
        {
            ContactService service = SpringFactory.GetObjectImpl<ContactService>("ContactService");
            service.insertInvoiceLogForDispute(disInvInstance);

        }
    }
}